var e = require;
var t = module;
var o = exports;
var Adv_skd=require("./Adv_skd");
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("NotifyEventType"),
    a = e("GlobalParams"),
    i = e("AudioManager"),
    r = e("ModuleUI"),
    s = e("UIManager"),
    l = e("AD"),
    c = e("Toast"),
    d = cc._decorator,
    h = d.ccclass,
    _ = d.property,
    u = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.popup_view_list = []), (t.popup_index = 0), t;
        }
        return (
            __extends(t, e),

            (t.prototype.onDisable = function () {

                Adv_skd.default.instance.hideBannerAd();
                Adv_skd.default.instance.hideGridAdLeft();
                Adv_skd.default.instance.hideGridAdRight();
                Adv_skd.default.instance.hideGridAdTop();
                Adv_skd.default.instance.hideGridAdLeftOne();
                Adv_skd.default.instance.hideGridAdRightOne();
                Adv_skd.default.instance.hideGridAdButtom();

            }),

            (t.prototype.initView = function () {

                Adv_skd.default.instance.hideBannerAd();
                Adv_skd.default.instance.hideGridAdLeft();
                Adv_skd.default.instance.hideGridAdRight();
                Adv_skd.default.instance.hideGridAdTop();
                Adv_skd.default.instance.hideGridAdLeftOne();
                Adv_skd.default.instance.hideGridAdRightOne();
                Adv_skd.default.instance.hideGridAdButtom();
                Adv_skd.default.instance.showGridAdLeft();
                Adv_skd.default.instance.showGridAdRight();
                Adv_skd.default.instance.showGridAdTop();
                Adv_skd.default.instance.showInterstitialAd();


                e.prototype.initView.call(this);
            }),
            (t.prototype.showPopupInfoView = function (e) {
                this.popup_index = e;
                for (var t = 0; t < this.popup_view_list.length; t++) this.popup_view_list[t].active = t == e;
            }),
            (t.prototype.OnClick = function (t) {
                var o = this;
                switch ((e.prototype.OnClick.call(this, t), t.node.name)) {
                    case "sure_btn":
                        l.default.getInstance().showVideo(function (e) {
                            if ((i.default.playGameBGM(), e == l.ResultEnum.Success))
                                if (0 == o.popup_index) cc.find("UIManager").getComponent(s.default).addCoinAni(50, 1);
                                else if (1 == o.popup_index) {
                                    var t = a.GlobalParams.PlayerInfo.value;
                                    (t.revive += 3),
                                        (a.GlobalParams.PlayerInfo.value = t),
                                        o.emitEvent(n.default.UPDATE_HAVE_REVIVE_NUMBER),
                                        c.default.showNewToast("恭喜获得3枚复活币");
                                } else if (2 == o.popup_index) {
                                    var r = a.GlobalParams.playerSkinInfo.value;
                                    (r.have.taste_card += 1),
                                        (a.GlobalParams.playerSkinInfo.value = r),
                                        o.emitEvent(n.default.UPDATE_HAVE_TASTE_CARD_NUMBER),
                                        c.default.showNewToast("恭喜获得1张英雄体验卡");
                                }
                        });
                        break;
                    case "back_btn":
                        this.node.destroy();
                }
            }),
            __decorate([_(cc.Node)], t.prototype, "popup_view_list", void 0),
            __decorate([h], t)
        );
    })(r.default);
o.default = u;
